package smashedapples.events
{
	import mx.rpc.AsyncToken;
	import mx.rpc.events.FaultEvent;
	
	public class AsyncChainEvent extends AppEvent
	{
		
		
		public static const CHAIN_COMPLETE:String = "chainComplete";
		
		
		public var tokens:Array = [];
		
		
		public function AsyncChainEvent( tokens:Array, bubbles:Boolean=true, cancelable:Boolean=false)
		{
			super( CHAIN_COMPLETE, {tokens:tokens}, bubbles, cancelable);
		}
		
		public function get success():Boolean
		{
			for each( var token:Object in this.tokens )
			{
				if( token is FaultEvent )
					return false;
			}
			
			return true;
		}
		
		
		
	}
}